﻿
using HBase;
using hCommand;
using System;
using System.Collections.Generic;

namespace Persistence {
    [Serializable]
    public class TaskRgv :BaseTask, LineMove {
        public static int getBaseDistance(Edge e) {
            return e.b;
        }

        public int rollerType {
            get; set;
        }



        public override List<string> getLableData() {
            List<String> list = new List<string>();
            list.Add(extra);
            list.Add("起点：" + src);
            list.Add("终点：" + des);
            return list;
        }


  public override void init(CoreTask complete, CoreTaskParam param, TaskDto taskDto,List<TaskDto> keyList) {
           
            DateTime now = DateTime.Now;
            extra = "Rgv任务 " + complete.boxCode + "path:" + taskDto.src + "-->" + taskDto.des;
           
      
    
            waveNo = complete.waveNo;
      


        }
        public Point getD() {
            int x = getX(des);
            if( x > 0 ) {
                return new Point(x ,0);
            }

            return null;
        }
        public Point getS() {
            int x = getX(src);
            if( x > 0 ) {
                return new Point(x ,0);
            }
            return null;
        }
        public bool refuse(int forkNo) {
            if( src / 1000 == 5 && forkNo == 2 ) {
                return true;
            }
            return false;
        }

        int getX(int pos) {
            switch( pos ) {
                case 6001:
                    return 5000;
                case 6003:
                    return 6000;
            }
            return 0;
        }
    }
}
